#ifndef ASYNCHRONOUSWORKER_H
#define ASYNCHRONOUSWORKER_H

#include <QThread>
#include <QMutex>

template <typename T>
class AsynchronousWorker : public QThread
{

public:
    AsynchronousWorker( QObject *parent=0 );
    void setFunction(T *objPtr, void (T::*fptr)());
    void setSubTaskId(int step);
    void setTaskDescription(QString task);

 protected:
    void run();

 private:
    void (T::*funcPtr)();
    T *objPtr;
    int subTask;
    QString taskDescription;
    QMutex mutex;
};

#endif // ASYNCHRONOUSWORKER_H
